#pragma once
// MESSAGE chaosheng PACKING

#define MAVLINK_MSG_ID_chaosheng 17000


typedef struct __mavlink_chaosheng_t {
 float ChaoSheng_240_1; /*<  float*/
 float ChaoSheng_240_2; /*<  float*/
 float ChaoSheng_700_1; /*<  float*/
 float ChaoSheng_700_2; /*<  float*/
 float ChaoSheng_1200_1; /*<  float*/
 float ChaoSheng_1200_2; /*<  float*/
} mavlink_chaosheng_t;

#define MAVLINK_MSG_ID_chaosheng_LEN 24
#define MAVLINK_MSG_ID_chaosheng_MIN_LEN 24
#define MAVLINK_MSG_ID_17000_LEN 24
#define MAVLINK_MSG_ID_17000_MIN_LEN 24

#define MAVLINK_MSG_ID_chaosheng_CRC 171
#define MAVLINK_MSG_ID_17000_CRC 171



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_chaosheng { \
    17000, \
    "chaosheng", \
    6, \
    {  { "ChaoSheng_240_1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_chaosheng_t, ChaoSheng_240_1) }, \
         { "ChaoSheng_240_2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_chaosheng_t, ChaoSheng_240_2) }, \
         { "ChaoSheng_700_1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_chaosheng_t, ChaoSheng_700_1) }, \
         { "ChaoSheng_700_2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_chaosheng_t, ChaoSheng_700_2) }, \
         { "ChaoSheng_1200_1", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_chaosheng_t, ChaoSheng_1200_1) }, \
         { "ChaoSheng_1200_2", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_chaosheng_t, ChaoSheng_1200_2) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_chaosheng { \
    "chaosheng", \
    6, \
    {  { "ChaoSheng_240_1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_chaosheng_t, ChaoSheng_240_1) }, \
         { "ChaoSheng_240_2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_chaosheng_t, ChaoSheng_240_2) }, \
         { "ChaoSheng_700_1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_chaosheng_t, ChaoSheng_700_1) }, \
         { "ChaoSheng_700_2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_chaosheng_t, ChaoSheng_700_2) }, \
         { "ChaoSheng_1200_1", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_chaosheng_t, ChaoSheng_1200_1) }, \
         { "ChaoSheng_1200_2", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_chaosheng_t, ChaoSheng_1200_2) }, \
         } \
}
#endif

/**
 * @brief Pack a chaosheng message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param ChaoSheng_240_1  float
 * @param ChaoSheng_240_2  float
 * @param ChaoSheng_700_1  float
 * @param ChaoSheng_700_2  float
 * @param ChaoSheng_1200_1  float
 * @param ChaoSheng_1200_2  float
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_chaosheng_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               float ChaoSheng_240_1, float ChaoSheng_240_2, float ChaoSheng_700_1, float ChaoSheng_700_2, float ChaoSheng_1200_1, float ChaoSheng_1200_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_chaosheng_LEN];
    _mav_put_float(buf, 0, ChaoSheng_240_1);
    _mav_put_float(buf, 4, ChaoSheng_240_2);
    _mav_put_float(buf, 8, ChaoSheng_700_1);
    _mav_put_float(buf, 12, ChaoSheng_700_2);
    _mav_put_float(buf, 16, ChaoSheng_1200_1);
    _mav_put_float(buf, 20, ChaoSheng_1200_2);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_chaosheng_LEN);
#else
    mavlink_chaosheng_t packet;
    packet.ChaoSheng_240_1 = ChaoSheng_240_1;
    packet.ChaoSheng_240_2 = ChaoSheng_240_2;
    packet.ChaoSheng_700_1 = ChaoSheng_700_1;
    packet.ChaoSheng_700_2 = ChaoSheng_700_2;
    packet.ChaoSheng_1200_1 = ChaoSheng_1200_1;
    packet.ChaoSheng_1200_2 = ChaoSheng_1200_2;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_chaosheng_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_chaosheng;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
}

/**
 * @brief Pack a chaosheng message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param ChaoSheng_240_1  float
 * @param ChaoSheng_240_2  float
 * @param ChaoSheng_700_1  float
 * @param ChaoSheng_700_2  float
 * @param ChaoSheng_1200_1  float
 * @param ChaoSheng_1200_2  float
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_chaosheng_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   float ChaoSheng_240_1,float ChaoSheng_240_2,float ChaoSheng_700_1,float ChaoSheng_700_2,float ChaoSheng_1200_1,float ChaoSheng_1200_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_chaosheng_LEN];
    _mav_put_float(buf, 0, ChaoSheng_240_1);
    _mav_put_float(buf, 4, ChaoSheng_240_2);
    _mav_put_float(buf, 8, ChaoSheng_700_1);
    _mav_put_float(buf, 12, ChaoSheng_700_2);
    _mav_put_float(buf, 16, ChaoSheng_1200_1);
    _mav_put_float(buf, 20, ChaoSheng_1200_2);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_chaosheng_LEN);
#else
    mavlink_chaosheng_t packet;
    packet.ChaoSheng_240_1 = ChaoSheng_240_1;
    packet.ChaoSheng_240_2 = ChaoSheng_240_2;
    packet.ChaoSheng_700_1 = ChaoSheng_700_1;
    packet.ChaoSheng_700_2 = ChaoSheng_700_2;
    packet.ChaoSheng_1200_1 = ChaoSheng_1200_1;
    packet.ChaoSheng_1200_2 = ChaoSheng_1200_2;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_chaosheng_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_chaosheng;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
}

/**
 * @brief Encode a chaosheng struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param chaosheng C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_chaosheng_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_chaosheng_t* chaosheng)
{
    return mavlink_msg_chaosheng_pack(system_id, component_id, msg, chaosheng->ChaoSheng_240_1, chaosheng->ChaoSheng_240_2, chaosheng->ChaoSheng_700_1, chaosheng->ChaoSheng_700_2, chaosheng->ChaoSheng_1200_1, chaosheng->ChaoSheng_1200_2);
}

/**
 * @brief Encode a chaosheng struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param chaosheng C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_chaosheng_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_chaosheng_t* chaosheng)
{
    return mavlink_msg_chaosheng_pack_chan(system_id, component_id, chan, msg, chaosheng->ChaoSheng_240_1, chaosheng->ChaoSheng_240_2, chaosheng->ChaoSheng_700_1, chaosheng->ChaoSheng_700_2, chaosheng->ChaoSheng_1200_1, chaosheng->ChaoSheng_1200_2);
}

/**
 * @brief Send a chaosheng message
 * @param chan MAVLink channel to send the message
 *
 * @param ChaoSheng_240_1  float
 * @param ChaoSheng_240_2  float
 * @param ChaoSheng_700_1  float
 * @param ChaoSheng_700_2  float
 * @param ChaoSheng_1200_1  float
 * @param ChaoSheng_1200_2  float
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_chaosheng_send(mavlink_channel_t chan, float ChaoSheng_240_1, float ChaoSheng_240_2, float ChaoSheng_700_1, float ChaoSheng_700_2, float ChaoSheng_1200_1, float ChaoSheng_1200_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_chaosheng_LEN];
    _mav_put_float(buf, 0, ChaoSheng_240_1);
    _mav_put_float(buf, 4, ChaoSheng_240_2);
    _mav_put_float(buf, 8, ChaoSheng_700_1);
    _mav_put_float(buf, 12, ChaoSheng_700_2);
    _mav_put_float(buf, 16, ChaoSheng_1200_1);
    _mav_put_float(buf, 20, ChaoSheng_1200_2);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_chaosheng, buf, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
#else
    mavlink_chaosheng_t packet;
    packet.ChaoSheng_240_1 = ChaoSheng_240_1;
    packet.ChaoSheng_240_2 = ChaoSheng_240_2;
    packet.ChaoSheng_700_1 = ChaoSheng_700_1;
    packet.ChaoSheng_700_2 = ChaoSheng_700_2;
    packet.ChaoSheng_1200_1 = ChaoSheng_1200_1;
    packet.ChaoSheng_1200_2 = ChaoSheng_1200_2;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_chaosheng, (const char *)&packet, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
#endif
}

/**
 * @brief Send a chaosheng message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_chaosheng_send_struct(mavlink_channel_t chan, const mavlink_chaosheng_t* chaosheng)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_chaosheng_send(chan, chaosheng->ChaoSheng_240_1, chaosheng->ChaoSheng_240_2, chaosheng->ChaoSheng_700_1, chaosheng->ChaoSheng_700_2, chaosheng->ChaoSheng_1200_1, chaosheng->ChaoSheng_1200_2);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_chaosheng, (const char *)chaosheng, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
#endif
}

#if MAVLINK_MSG_ID_chaosheng_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This variant of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_chaosheng_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float ChaoSheng_240_1, float ChaoSheng_240_2, float ChaoSheng_700_1, float ChaoSheng_700_2, float ChaoSheng_1200_1, float ChaoSheng_1200_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_float(buf, 0, ChaoSheng_240_1);
    _mav_put_float(buf, 4, ChaoSheng_240_2);
    _mav_put_float(buf, 8, ChaoSheng_700_1);
    _mav_put_float(buf, 12, ChaoSheng_700_2);
    _mav_put_float(buf, 16, ChaoSheng_1200_1);
    _mav_put_float(buf, 20, ChaoSheng_1200_2);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_chaosheng, buf, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
#else
    mavlink_chaosheng_t *packet = (mavlink_chaosheng_t *)msgbuf;
    packet->ChaoSheng_240_1 = ChaoSheng_240_1;
    packet->ChaoSheng_240_2 = ChaoSheng_240_2;
    packet->ChaoSheng_700_1 = ChaoSheng_700_1;
    packet->ChaoSheng_700_2 = ChaoSheng_700_2;
    packet->ChaoSheng_1200_1 = ChaoSheng_1200_1;
    packet->ChaoSheng_1200_2 = ChaoSheng_1200_2;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_chaosheng, (const char *)packet, MAVLINK_MSG_ID_chaosheng_MIN_LEN, MAVLINK_MSG_ID_chaosheng_LEN, MAVLINK_MSG_ID_chaosheng_CRC);
#endif
}
#endif

#endif

// MESSAGE chaosheng UNPACKING


/**
 * @brief Get field ChaoSheng_240_1 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_240_1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field ChaoSheng_240_2 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_240_2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  4);
}

/**
 * @brief Get field ChaoSheng_700_1 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_700_1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field ChaoSheng_700_2 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_700_2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field ChaoSheng_1200_1 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_1200_1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field ChaoSheng_1200_2 from chaosheng message
 *
 * @return  float
 */
static inline float mavlink_msg_chaosheng_get_ChaoSheng_1200_2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Decode a chaosheng message into a struct
 *
 * @param msg The message to decode
 * @param chaosheng C-struct to decode the message contents into
 */
static inline void mavlink_msg_chaosheng_decode(const mavlink_message_t* msg, mavlink_chaosheng_t* chaosheng)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    chaosheng->ChaoSheng_240_1 = mavlink_msg_chaosheng_get_ChaoSheng_240_1(msg);
    chaosheng->ChaoSheng_240_2 = mavlink_msg_chaosheng_get_ChaoSheng_240_2(msg);
    chaosheng->ChaoSheng_700_1 = mavlink_msg_chaosheng_get_ChaoSheng_700_1(msg);
    chaosheng->ChaoSheng_700_2 = mavlink_msg_chaosheng_get_ChaoSheng_700_2(msg);
    chaosheng->ChaoSheng_1200_1 = mavlink_msg_chaosheng_get_ChaoSheng_1200_1(msg);
    chaosheng->ChaoSheng_1200_2 = mavlink_msg_chaosheng_get_ChaoSheng_1200_2(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_chaosheng_LEN? msg->len : MAVLINK_MSG_ID_chaosheng_LEN;
        memset(chaosheng, 0, MAVLINK_MSG_ID_chaosheng_LEN);
    memcpy(chaosheng, _MAV_PAYLOAD(msg), len);
#endif
}
